package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class IODemo4 {

    public static void main(String[] args) throws IOException {
        try (InputStream inputStream = new FileInputStream("f:/test.txt")) {
            try(Scanner scanner = new Scanner(inputStream,"UTF-8")){
                while (scanner.hasNext()){
                    String s = scanner.nextLine();
                    System.out.println(s);
                }
            }
        }
    }
}
